<!---
Filename


--->

<cfcomponent output="false">
	<cfset this.name = "CFControl_testing">
	<cfset this.applicationTimeout = createTimeSpan(0,1,0,0)>
	<cfset this.loginStorage = "session">
	<cfset this.sessionManagement = true>
	<cfset this.sessionTimeout = createTimeSpan(0,0,20,0)>

	<cfset variables._cfcontrol = "" />

	<cffunction name="onApplicationStart" returnType="boolean" output="false">
		<cfargument name="config" type="any" />

		<!--- Settings via Coldspring --->
		<cfset application.beanFactory = createObject("component","coldspring.beans.DefaultXmlBeanFactory").init()/>
		<cfset application.beanFactory.loadBeansFromXmlFile(expandPath("/config/coldspring.xml"),true)/>

		<cfscript>
			filePrefix = structNew();
			filePrefix['dsp'] = "Display pages";
			filePrefix['act'] = "Action pages";
			filePrefix['qry'] = "Query page";
		</cfscript>


		<cfreturn true>
	</cffunction>

	<cffunction name="onApplicationEnd" returnType="void" output="false">
		<cfargument name="applicationScope" required="true">
	</cffunction>

	<cffunction name="onRequestStart" returnType="boolean" output="false">
		<cfargument name="thePage" type="string" required="true">
		<!--- Puts the bean settings into a cfc local variable --->
		<cfset variables._cfcontrol = application.beanFactory.getBean('controlConfig')/>

			<cfdump var="#url#">
			SUDO
				using the action URL find files relating 
			<!--- Reset the application variables --->
			<cfif variables._cfcontrol.getReload() OR (isDefined("url.#_cfcontrol.getReloadKey()#") AND url[_cfcontrol.getReloadKey()] EQ _cfcontrol.getReloadPassword())>
				<cfset onApplicationStart()>
			</cfif>

		<cfreturn true>
	</cffunction>


	<!---<cffunction name="onRequest" returnType="void">
		<cfargument name="thePage" type="string" required="true">
			<cfinclude template="#arguments.thePage#">

	</cffunction> --->

	<cffunction name="onRequestEnd" returnType="void" output="false">
		<cfargument name="thePage" type="string" required="true">
		<cfset arguments.thePage = "" />


		<cfsetting showdebugoutput="#variables._cfcontrol.getDebug()#" />
	</cffunction>


	<cffunction name="onSessionStart" returnType="void" output="false">
	</cffunction>

	<cffunction name="onSessionEnd" returnType="void" output="false">
		<cfargument name="sessionScope" type="struct" required="true">
		<cfargument name="appScope" type="struct" required="false">
	</cffunction>

</cfcomponent>
